home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
Devices.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
32KB
|
1,090 lines
;
; File: Devices.a
;
; Contains: Device Manager Interfaces.
;
; Version: Technology: System 7.5 and 8
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__DEVICES__') = 'UNDEFINED' THEN
__DEVICES__ SET 1
IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
include 'OSUtils.a'
ENDIF
IF &TYPE('__FILES__') = 'UNDEFINED' THEN
include 'Files.a'
ENDIF
IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
include 'Quickdraw.a'
ENDIF
IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
include 'Events.a'
ENDIF
IF FOR_SYSTEM7_ONLY THEN
IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
include 'Dialogs.a'
ENDIF
ENDIF
IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
include 'Kernel.a'
ENDIF
IF &TYPE('__NAMEREGISTRY__') = 'UNDEFINED' THEN
include 'NameRegistry.a'
ENDIF
IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
include 'CodeFragments.a'
ENDIF
IF &TYPE('__DRIVERFAMILYMATCHING__') = 'UNDEFINED' THEN
include 'DriverFamilyMatching.a'
ENDIF
IF &TYPE('__IOITERATOR__') = 'UNDEFINED' THEN
include 'IOIterator.a'
ENDIF
; Values of the 'message' parameter to a Chooser device package
chooserInitMsg EQU 11 ; the user selected this device package
newSelMsg EQU 12 ; the user made new device selections
fillListMsg EQU 13 ; fill the device list with choices
getSelMsg EQU 14 ; mark one or more choices as selected
selectMsg EQU 15 ; the user made a selection
deselectMsg EQU 16 ; the user canceled a selection
terminateMsg EQU 17 ; allows device package to clean up
buttonMsg EQU 19 ; the user selected a button
; Values of the 'caller' parameter to a Chooser device package
chooserID EQU 1
; Values of the 'message' parameter to a Control Panel 'cdev'
initDev EQU 0 ;Time for cdev to initialize itself
hitDev EQU 1 ;Hit on one of my items
closeDev EQU 2 ;Close yourself
nulDev EQU 3 ;Null event
updateDev EQU 4 ;Update event
activDev EQU 5 ;Activate event
deactivDev EQU 6 ;Deactivate event
keyEvtDev EQU 7 ;Key down/auto key
macDev EQU 8 ;Decide whether or not to show up
undoDev EQU 9
cutDev EQU 10
copyDev EQU 11
pasteDev EQU 12
clearDev EQU 13
cursorDev EQU 14
; Special values a Control Panel 'cdev' can return
cdevGenErr EQU -1 ;General error; gray cdev w/o alert
cdevMemErr EQU 0 ;Memory shortfall; alert user please
cdevResErr EQU 1 ;Couldn't get a needed resource; alert
cdevUnset EQU 3 ; cdevValue is initialized to this
; Values of the 'message' parameter to a Monitor 'mntr'
initMsg EQU 1 ;initialization
okMsg EQU 2 ;user clicked OK button
cancelMsg EQU 3 ;user clicked Cancel button
hitMsg EQU 4 ;user clicked control in Options dialog
nulMsg EQU 5 ;periodic event
updateMsg EQU 6 ;update event
activateMsg EQU 7 ;not used
deactivateMsg EQU 8 ;not used
keyEvtMsg EQU 9 ;keyboard event
superMsg EQU 10 ;show superuser controls
normalMsg EQU 11 ;show only normal controls
startupMsg EQU 12 ;code has been loaded
; control codes for DeskAccessories
goodbye EQU -1 ; heap being reinitialized
killCode EQU 1 ; KillIO requested
accEvent EQU 64 ; handle an event
accRun EQU 65 ; time for periodic action
accCursor EQU 66 ; change cursor shape
accMenu EQU 67 ; handle menu item
accUndo EQU 68 ; handle undo command
accCut EQU 70 ; handle cut command
accCopy EQU 71 ; handle copy command
accPaste EQU 72 ; handle paste command
accClear EQU 73 ; handle clear command
; Control/Status Call Codes
drvStsCode EQU 8 ; status call code for drive status
ejectCode EQU 7 ; control call eject code
tgBuffCode EQU 8 ; set tag buffer code
; miscellaneous Device Manager constants
ioInProgress EQU 1 ; predefined value of ioResult while I/O is pending
aRdCmd EQU 2 ; low byte of ioTrap for Read calls
aWrCmd EQU 3 ; low byte of ioTrap for Write calls
asyncTrpBit EQU 10 ; trap word modifier
noQueueBit EQU 9 ; trap word modifier
; flags used in the driver header and device control entry
dReadEnable EQU 0 ; set if driver responds to read requests
dWritEnable EQU 1 ; set if driver responds to write requests
dCtlEnable EQU 2 ; set if driver responds to control requests
dStatEnable EQU 3 ; set if driver responds to status requests
dNeedGoodBye EQU 4 ; set if driver needs time for performing periodic tasks
dNeedTime EQU 5 ; set if driver needs time for performing periodic tasks
dNeedLock EQU 6 ; set if driver must be locked in memory as soon as it is opened
dNeedLockMask EQU $4000 ; set if driver must be locked in memory as soon as it is opened
dNeedTimeMask EQU $2000 ; set if driver needs time for performing periodic tasks
dNeedGoodByeMask EQU $1000 ; set if driver needs to be called before the application heap is initialized
dStatEnableMask EQU $0800 ; set if driver responds to status requests
dCtlEnableMask EQU $0400 ; set if driver responds to control requests
dWritEnableMask EQU $0200 ; set if driver responds to write requests
dReadEnableMask EQU $0100 ; set if driver responds to read requests
; run-time flags used in the device control entry
dOpened EQU 5 ; driver is open
dRAMBased EQU 6 ; dCtlDriver is a handle (1) or pointer (0)
drvrActive EQU 7 ; driver is currently processing a request
drvrActiveMask EQU $0080 ; driver is currently processing a request
dRAMBasedMask EQU $0040 ; dCtlDriver is a handle (1) or pointer (0)
dOpenedMask EQU $0020 ; driver is open
DRVRHeader RECORD 0
drvrFlags ds.w 1 ; offset: $0 (0)
drvrDelay ds.w 1 ; offset: $2 (2)
drvrEMask ds.w 1 ; offset: $4 (4)
drvrMenu ds.w 1 ; offset: $6 (6)
drvrOpen ds.w 1 ; offset: $8 (8)
drvrPrime ds.w 1 ; offset: $A (10)
drvrCtl ds.w 1 ; offset: $C (12)
drvrStatus ds.w 1 ; offset: $E (14)
drvrClose ds.w 1 ; offset: $10 (16)
drvrName ds.b 1 ; offset: $12 (18) <-- really an array of length one
ORG 20
sizeof EQU * ; size: $14 (20)
ENDR
; typedef struct DRVRHeader * DRVRHeaderPtr
; typedef DRVRHeaderPtr * DRVRHeaderHandle
IF FOR_SYSTEM7_ONLY THEN
DCtlEntry RECORD 0
dCtlDriver ds.l 1 ; offset: $0 (0)
dCtlFlags ds.w 1 ; offset: $4 (4)
dCtlQHdr ds QHdr ; offset: $6 (6)
dCtlPosition ds.l 1 ; offset: $10 (16)
dCtlStorage ds.l 1 ; offset: $14 (20)
dCtlRefNum ds.w 1 ; offset: $18 (24)
dCtlCurTicks ds.l 1 ; offset: $1A (26)
dCtlWindow ds.l 1 ; offset: $1E (30)
dCtlDelay ds.w 1 ; offset: $22 (34)
dCtlEMask ds.w 1 ; offset: $24 (36)
dCtlMenu ds.w 1 ; offset: $26 (38)
sizeof EQU * ; size: $28 (40)
ENDR
ELSE
DCtlEntry RECORD 0
dCtlDriver ds.l 1 ; offset: $0 (0)
dCtlFlags ds.w 1 ; offset: $4 (4)
dCtlQHdr ds QHdr ; offset: $6 (6)
dCtlPosition ds.l 1 ; offset: $10 (16)
dCtlStorage ds.l 1 ; offset: $14 (20)
dCtlRefNum ds.w 1 ; offset: $18 (24)
dCtlCurTicks ds.l 1 ; offset: $1A (26)
dCtlWindow ds.l 1 ; offset: $1E (30)
dCtlDelay ds.w 1 ; offset: $22 (34)
dCtlEMask ds.w 1 ; offset: $24 (36)
dCtlMenu ds.w 1 ; offset: $26 (38)
sizeof EQU * ; size: $28 (40)
ENDR
ENDIF
; typedef struct DCtlEntry * DCtlPtr
; typedef DCtlPtr * DCtlHandle
IF FOR_SYSTEM7_ONLY THEN
AuxDCE RECORD 0
dCtlDriver ds.l 1 ; offset: $0 (0)
dCtlFlags ds.w 1 ; offset: $4 (4)
dCtlQHdr ds QHdr ; offset: $6 (6)
dCtlPosition ds.l 1 ; offset: $10 (16)
dCtlStorage ds.l 1 ; offset: $14 (20)
dCtlRefNum ds.w 1 ; offset: $18 (24)
dCtlCurTicks ds.l 1 ; offset: $1A (26)
dCtlWindow ds.l 1 ; offset: $1E (30)
dCtlDelay ds.w 1 ; offset: $22 (34)
dCtlEMask ds.w 1 ; offset: $24 (36)
dCtlMenu ds.w 1 ; offset: $26 (38)
dCtlSlot ds.b 1 ; offset: $28 (40)
dCtlSlotId ds.b 1 ; offset: $29 (41)
dCtlDevBase ds.l 1 ; offset: $2A (42)
dCtlOwner ds.l 1 ; offset: $2E (46)
dCtlExtDev ds.b 1 ; offset: $32 (50)
fillByte ds.b 1 ; offset: $33 (51)
dCtlNodeID ds.l 1 ; offset: $34 (52)
sizeof EQU * ; size: $38 (56)
ENDR
; typedef struct AuxDCE * AuxDCEPtr
; typedef AuxDCEPtr * AuxDCEHandle
ELSE
AuxDCE RECORD 0
dCtlDriver ds.l 1 ; offset: $0 (0)
dCtlFlags ds.w 1 ; offset: $4 (4)
dCtlQHdr ds QHdr ; offset: $6 (6)
dCtlPosition ds.l 1 ; offset: $10 (16)
dCtlStorage ds.l 1 ; offset: $14 (20)
dCtlRefNum ds.w 1 ; offset: $18 (24)
dCtlCurTicks ds.l 1 ; offset: $1A (26)
dCtlWindow ds.l 1 ; offset: $1E (30)
dCtlDelay ds.w 1 ; offset: $22 (34)
dCtlEMask ds.w 1 ; offset: $24 (36)
dCtlMenu ds.w 1 ; offset: $26 (38)
dCtlSlot ds.b 1 ; offset: $28 (40)
dCtlSlotId ds.b 1 ; offset: $29 (41)
dCtlDevBase ds.l 1 ; offset: $2A (42)
dCtlOwner ds.l 1 ; offset: $2E (46)
dCtlExtDev ds.b 1 ; offset: $32 (50)
fillByte ds.b 1 ; offset: $33 (51)
dCtlNodeID ds.l 1 ; offset: $34 (52)
sizeof EQU * ; size: $38 (56)
ENDR
; typedef struct AuxDCE * AuxDCEPtr
; typedef AuxDCEPtr * AuxDCEHandle
ENDIF
; The NDRV Driver IO Entry Point and Commands
; typedef UInt16 UnitNumber
; typedef UInt32 DriverOpenCount
; typedef SInt16 DriverRefNum
; typedef SInt16 DriverFlags
; typedef UInt32 IOCommandCode
kOpenCommand EQU 0
kCloseCommand EQU 1
kReadCommand EQU 2
kWriteCommand EQU 3
kControlCommand EQU 4
kStatusCommand EQU 5
kKillIOCommand EQU 6
kInitializeCommand EQU 7 ; init driver and device
kFinalizeCommand EQU 8 ; shutdown driver and device
kReplaceCommand EQU 9 ; replace an old driver
kSupersededCommand EQU 10 ; prepare to be replaced by a new driver
; typedef UInt32 IOCommandKind
kSynchronousIOCommandKind EQU $00000001
kAsynchronousIOCommandKind EQU $00000002
kImmediateIOCommandKind EQU $00000004
DriverInitInfo RECORD 0
refNum ds.w 1 ; offset: $0 (0)
deviceEntry ds RegEntryRef ; offset: $2 (2)
sizeof EQU * ; size: $12 (18)
ENDR
; typedef struct DriverInitInfo * DriverInitInfoPtr
DriverReplaceInfo RECORD 0
f ds DriverInitInfo
sizeof EQU * ; size: $12 (18)
ENDR
; typedef struct DriverInitInfo * DriverReplaceInfoPtr
DriverFinalInfo RECORD 0
refNum ds.w 1 ; offset: $0 (0)
deviceEntry ds RegEntryRef ; offset: $2 (2)
sizeof EQU * ; size: $12 (18)
ENDR
; typedef struct DriverFinalInfo * DriverFinalInfoPtr
DriverSupersededInfo RECORD 0
f ds DriverFinalInfo
sizeof EQU * ; size: $12 (18)
ENDR
; typedef struct DriverFinalInfo * DriverSupersededInfoPtr
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
; Contents are command specific
IOCommandContents RECORD 0
pb ds.l 1 ; offset: $0 (0)
ORG 0
initialInfo ds.l 1 ; offset: $0 (0)
ORG 0
finalInfo ds.l 1 ; offset: $0 (0)
ORG 0
replaceInfo ds.l 1 ; offset: $0 (0)
ORG 0
supersededInfo ds.l 1 ; offset: $0 (0)
sizeof EQU * ; size: $4 (4)
ENDR
ELSE
ParamBlockRec RECORD 0
qLink ds.l 1 ; offset: $0 (0) ; queue link in header
qType ds.w 1 ; offset: $4 (4) ; type byte for safety check
ioTrap ds.w 1 ; offset: $6 (6) ; FS: the Trap
ioCmdAddr ds.l 1 ; offset: $8 (8) ; FS: address to dispatch to
ioCompletion ds.l 1 ; offset: $C (12) ; completion routine addr (0 for synch calls)
ioResult ds.w 1 ; offset: $10 (16) ; result code
ioNamePtr ds.l 1 ; offset: $12 (18) ; ptr to Vol:FileName string
ioVRefNum ds.w 1 ; offset: $16 (22) ; volume refnum (DrvNum for Eject and MountVol)
ioRefNum ds.w 1 ; offset: $18 (24) ; refNum for I/O operation
ioVersNum ds.b 1 ; offset: $1A (26) ; version number
ioPermssn ds.b 1 ; offset: $1B (27) ; Open: permissions (byte)
ioMisc ds.l 1 ; offset: $1C (28) ; Rename: new name (GetEOF,SetEOF: logical end of file) (Open: optional ptr to buffer) (SetFileType: new type)
ioBuffer ds.l 1 ; offset: $20 (32) ; data buffer Ptr
ioReqCount ds.l 1 ; offset: $24 (36) ; requested byte count; also = ioNewDirID
ioActCount ds.l 1 ; offset: $28 (40) ; actual byte count completed
ioPosMode ds.w 1 ; offset: $2C (44) ; initial file positioning
ioPosOffset ds.l 1 ; offset: $2E (46) ; file position offset
ORG 24
ioCRefNum ds.w 1 ; offset: $18 (24) ; refNum for I/O operation
csCode ds.w 1 ; offset: $1A (26) ; word for control status code
csParam ds.w 11 ; offset: $1C (28) ; operation-defined parameters
sizeof EQU * ; size: $32 (50)
ENDR
; typedef struct ParamBlockRec * ParmBlkPtr
IOCommandContents RECORD 0
pb ds.l 1 ; offset: $0 (0)
ORG 0
initialInfo ds.l 1 ; offset: $0 (0)
ORG 0
finalInfo ds.l 1 ; offset: $0 (0)
ORG 0
replaceInfo ds.l 1 ; offset: $0 (0)
ORG 0
supersededInfo ds.l 1 ; offset: $0 (0)
sizeof EQU * ; size: $4 (4)
ENDR
ENDIF
; Record to describe a file-based driver candidate
FileBasedDriverRecord RECORD 0
theSpec ds FSSpec ; offset: $0 (0) ; file specification
theType ds DriverType ; offset: $46 (70) ; nameInfoStr + version number
compatibleProp ds.b 1 ; offset: $6A (106) ; true if matched using a compatible name
pad ds.b 3 ; offset: $6B (107) ; alignment
sizeof EQU * ; size: $6E (110)
ENDR
; typedef struct FileBasedDriverRecord * FileBasedDriverRecordPtr
; Driver Loader API
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
;
; extern SInt16 HigherDriverVersion(NumVersion *driverVersion1, NumVersion *driverVersion2)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION HigherDriverVersion
ENDIF
;
; extern OSErr VerifyFragmentAsDriver(CFragConnectionID fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION VerifyFragmentAsDriver
ENDIF
;
; extern OSErr GetDriverMemoryFragment(Ptr memAddr, long length, ConstStr63Param fragName, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetDriverMemoryFragment
ENDIF
;
; extern OSErr GetDriverDiskFragment(FSSpecPtr fragmentSpec, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetDriverDiskFragment
ENDIF
IF FOR_SYSTEM7_ONLY THEN
;
; extern OSErr InstallDriverFromFragment(CFragConnectionID fragmentConnID, RegEntryID *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromFragment
ENDIF
;
; extern OSErr InstallDriverFromFile(FSSpecPtr fragmentSpec, RegEntryID *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromFile
ENDIF
;
; extern OSErr InstallDriverFromMemory(Ptr memory, long length, ConstStr63Param fragName, RegEntryID *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromMemory
ENDIF
;
; extern OSErr InstallDriverFromDisk(Ptr theDriverName, RegEntryID *theDevice, UnitNumber theBeginningUnit, UnitNumber theEndingUnit, DriverRefNum *theRefNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromDisk
ENDIF
;
; extern OSErr FindDriversForDevice(RegEntryID *device, FSSpec *fragmentSpec, DriverDescription *fileDriverDesc, Ptr *memAddr, long *length, StringPtr fragName, DriverDescription *memDriverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION FindDriversForDevice
ENDIF
;
; extern OSErr FindDriverCandidates(RegEntryID *deviceID, Ptr *propBasedDriver, RegPropertyValueSize *propBasedDriverSize, StringPtr deviceName, DriverType *propBasedDriverType, Boolean *gotPropBasedDriver, FileBasedDriverRecordPtr fileBasedDrivers, ItemCount *nFileBasedDrivers)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION FindDriverCandidates
ENDIF
;
; extern OSErr ScanDriverCandidates(RegEntryID *deviceID, FileBasedDriverRecordPtr fileBasedDrivers, ItemCount nFileBasedDrivers, FileBasedDriverRecordPtr matchingDrivers, ItemCount *nMatchingDrivers)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ScanDriverCandidates
ENDIF
;
; extern OSErr GetDriverForDevice(RegEntryID *device, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetDriverForDevice
ENDIF
;
; extern OSErr InstallDriverForDevice(RegEntryID *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverForDevice
ENDIF
;
; extern OSErr GetDriverInformation(DriverRefNum refNum, UnitNumber *unitNum, DriverFlags *flags, DriverOpenCount *count, StringPtr name, RegEntryID *device, CFragSystem7Locator *driverLoadLocation, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescription *driverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetDriverInformation
ENDIF
ELSE
;
; extern OSErr InstallDriverFromFragment(CFragConnectionID fragmentConnID, RegEntryRef *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromFragment
ENDIF
;
; extern OSErr InstallDriverFromFile(FSSpecPtr fragmentSpec, RegEntryRef *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromFile
ENDIF
;
; extern OSErr InstallDriverFromMemory(Ptr memory, long length, ConstStr63Param fragName, RegEntryRef *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromMemory
ENDIF
;
; extern OSErr InstallDriverFromDisk(Ptr theDriverName, RegEntryRef *theDevice, UnitNumber theBeginningUnit, UnitNumber theEndingUnit, DriverRefNum *theRefNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverFromDisk
ENDIF
;
; extern OSErr FindDriversForDevice(RegEntryRef *device, FSSpec *fragmentSpec, DriverDescription *fileDriverDesc, Ptr *memAddr, long *length, StringPtr fragName, DriverDescription *memDriverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION FindDriversForDevice
ENDIF
;
; extern OSErr FindDriverCandidates(RegEntryRef *deviceID, Ptr *propBasedDriver, UInt32 *propBasedDriverSize, StringPtr deviceName, DriverType *propBasedDriverType, Boolean *gotPropBasedDriver, FileBasedDriverRecordPtr fileBasedDrivers, ItemCount *nFileBasedDrivers)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION FindDriverCandidates
ENDIF
;
; extern OSErr ScanDriverCandidates(RegEntryRef *deviceID, FileBasedDriverRecordPtr fileBasedDrivers, ItemCount nFileBasedDrivers, FileBasedDriverRecordPtr matchingDrivers, ItemCount *nMatchingDrivers)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ScanDriverCandidates
ENDIF
;
; extern OSErr GetDriverForDevice(RegEntryRef *device, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetDriverForDevice
ENDIF
;
; extern OSErr InstallDriverForDevice(RegEntryRef *device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallDriverForDevice
ENDIF
ENDIF
;
; extern OSErr SetDriverClosureMemory(CFragConnectionID fragmentConnID, Boolean holdDriverMemory)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetDriverClosureMemory
ENDIF
;
; extern OSErr ReplaceDriverWithFragment(DriverRefNum theRefNum, CFragConnectionID fragmentConnID)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReplaceDriverWithFragment
ENDIF
;
; extern OSErr OpenInstalledDriver(DriverRefNum refNum, SInt8 ioPermission)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION OpenInstalledDriver
ENDIF
;
; extern OSErr RenameDriver(DriverRefNum refNum, StringPtr newDriverName)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION RenameDriver
ENDIF
;
; extern OSErr RemoveDriver(DriverRefNum refNum, Boolean immediate)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION RemoveDriver
ENDIF
;
; extern OSErr LookupDrivers(UnitNumber beginningUnit, UnitNumber endingUnit, Boolean emptyUnits, ItemCount *returnedRefNums, DriverRefNum *refNums)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION LookupDrivers
ENDIF
;
; extern UnitNumber HighestUnitNumber(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION HighestUnitNumber
ENDIF
;
; extern OSErr DriverGestaltOn(DriverRefNum refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DriverGestaltOn
ENDIF
;
; extern OSErr DriverGestaltOff(DriverRefNum refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DriverGestaltOff
ENDIF
;
; extern Boolean DriverGestaltIsOn(DriverFlags flags)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DriverGestaltIsOn
ENDIF
ENDIF
IF ¨ OLDROUTINELOCATIONS THEN
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
;
; pascal OSErr PBOpenSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBOpenSync: OPWORD $A000
ELSE
IMPORT_CFM_FUNCTION PBOpenSync
ENDIF
;
; pascal OSErr PBOpenAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBOpenAsync: OPWORD $A400
ELSE
IMPORT_CFM_FUNCTION PBOpenAsync
ENDIF
;
; pascal OSErr PBOpenImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBOpenImmed: OPWORD $A200
ELSE
IMPORT_CFM_FUNCTION PBOpenImmed
ENDIF
;
; pascal OSErr PBCloseSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBCloseSync: OPWORD $A001
ELSE
IMPORT_CFM_FUNCTION PBCloseSync
ENDIF
;
; pascal OSErr PBCloseAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBCloseAsync: OPWORD $A401
ELSE
IMPORT_CFM_FUNCTION PBCloseAsync
ENDIF
;
; pascal OSErr PBCloseImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBCloseImmed: OPWORD $A201
ELSE
IMPORT_CFM_FUNCTION PBCloseImmed
ENDIF
;
; pascal OSErr PBReadSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBReadSync: OPWORD $A002
ELSE
IMPORT_CFM_FUNCTION PBReadSync
ENDIF
;
; pascal OSErr PBReadAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBReadAsync: OPWORD $A402
ELSE
IMPORT_CFM_FUNCTION PBReadAsync
ENDIF
;
; pascal OSErr PBReadImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBReadImmed: OPWORD $A202
ELSE
IMPORT_CFM_FUNCTION PBReadImmed
ENDIF
;
; pascal OSErr PBWriteSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBWriteSync: OPWORD $A003
ELSE
IMPORT_CFM_FUNCTION PBWriteSync
ENDIF
;
; pascal OSErr PBWriteAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBWriteAsync: OPWORD $A403
ELSE
IMPORT_CFM_FUNCTION PBWriteAsync
ENDIF
;
; pascal OSErr PBWriteImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBWriteImmed: OPWORD $A203
ELSE
IMPORT_CFM_FUNCTION PBWriteImmed
ENDIF
;
; pascal void AddDrive(short drvrRefNum, short drvNum, DrvQElPtr qEl)
;
IF ¨ GENERATINGCFM THEN
_AddDrive: OPWORD $A04E
ELSE
IMPORT_CFM_FUNCTION AddDrive
ENDIF
ENDIF
;
; pascal QHdrPtr GetDrvQHdr(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_GetDrvQHdr &dest=(sp)
move.l #$00000308,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION GetDrvQHdr
ENDIF
ENDIF
; Control Panel Default Proc
IF FOR_SYSTEM7_ONLY THEN
ENDIF
;
; pascal DCtlHandle GetDCtlEntry(short refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetDCtlEntry
ENDIF
;
; SetChooserAlert used to simply set a bit in a low-mem global
; to tell the Chooser not to display its warning message when
; the printer is changed. However, under MultiFinder and System 7,
; this low-mem is swapped out when a layer change occurs, and the
; Chooser never sees the change. It is obsolete, and completely
; unsupported on the PowerPC. 68K apps can still call it if they
; wish.
;
;
IF OLDROUTINENAMES ** ¨ GENERATINGCFM THEN
;
; pascal Boolean SetChooserAlert(Boolean f)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetChooserAlert
ENDIF
ENDIF
;
; pascal OSErr DriverInstall(DRVRHeaderPtr drvrPtr, short refNum)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; drvrPtr => A0
; refNum => D0
; returns:
; OSErr <= D0
_DriverInstall: OPWORD $A03D
ELSE
IMPORT_CFM_FUNCTION DriverInstall
ENDIF
;
; pascal OSErr DriverInstallReserveMem(DRVRHeaderPtr drvrPtr, short refNum)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; drvrPtr => A0
; refNum => D0
; returns:
; OSErr <= D0
_DriverInstallReserveMem: OPWORD $A43D
ELSE
IMPORT_CFM_FUNCTION DriverInstallReserveMem
ENDIF
;
; Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
; There will soon be a DriverInstall() which does the right thing.
;
; DrvrRemove has been renamed to DriverRemove. But, InterfaceLib for PowerPC
; still exports DrvrRemove, so a macro is used to map the new name to old.
;
;
;
; pascal OSErr DrvrRemove(short refNum)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; refNum => D0
; returns:
; OSErr <= D0
_DrvrRemove: OPWORD $A03E
ELSE
IMPORT_CFM_FUNCTION DrvrRemove
ENDIF
;
; Shim mechnanism only exist in Copland world. A Shim is a translation layer
; and looks like a DRVR.
;
;
; pascal OSStatus DriverInstallShim(DRVRHeaderPtr drvrPtr, ShimEntryPoint shim, short refNum, void *refcon)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DriverInstallShim
ENDIF
;
; pascal OSStatus DriverRemoveShim(short refNum)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DriverRemoveShim
ENDIF
;
; pascal OSStatus DriverReturnShimRefcon(short refNum, void **refcon)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DriverReturnShimRefcon
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
;
; extern OSErr IOShimCommandIsComplete(ParmBlkPtr thePB, OSErr result)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION IOShimCommandIsComplete
ENDIF
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
;
; pascal OSErr PBControlSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBControlSync: OPWORD $A004
ELSE
IMPORT_CFM_FUNCTION PBControlSync
ENDIF
;
; pascal OSErr PBControlAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBControlAsync: OPWORD $A404
ELSE
IMPORT_CFM_FUNCTION PBControlAsync
ENDIF
;
; pascal OSErr PBControlImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBControlImmed: OPWORD $A204
ELSE
IMPORT_CFM_FUNCTION PBControlImmed
ENDIF
;
; pascal OSErr PBStatusSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBStatusSync: OPWORD $A005
ELSE
IMPORT_CFM_FUNCTION PBStatusSync
ENDIF
;
; pascal OSErr PBStatusAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBStatusAsync: OPWORD $A405
ELSE
IMPORT_CFM_FUNCTION PBStatusAsync
ENDIF
;
; pascal OSErr PBStatusImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBStatusImmed: OPWORD $A205
ELSE
IMPORT_CFM_FUNCTION PBStatusImmed
ENDIF
;
; pascal OSErr PBKillIOSync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBKillIOSync: OPWORD $A006
ELSE
IMPORT_CFM_FUNCTION PBKillIOSync
ENDIF
;
; pascal OSErr PBKillIOAsync(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBKillIOAsync: OPWORD $A406
ELSE
IMPORT_CFM_FUNCTION PBKillIOAsync
ENDIF
;
; pascal OSErr PBKillIOImmed(ParmBlkPtr paramBlock)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; paramBlock => A0
; returns:
; OSErr <= D0
_PBKillIOImmed: OPWORD $A206
ELSE
IMPORT_CFM_FUNCTION PBKillIOImmed
ENDIF
ENDIF
;
; pascal short OpenDeskAcc(ConstStr255Param deskAccName)
;
IF ¨ GENERATINGCFM THEN
_OpenDeskAcc: OPWORD $A9B6
ELSE
IMPORT_CFM_FUNCTION OpenDeskAcc
ENDIF
;
; pascal void CloseDeskAcc(short refNum)
;
IF ¨ GENERATINGCFM THEN
_CloseDeskAcc: OPWORD $A9B7
ELSE
IMPORT_CFM_FUNCTION CloseDeskAcc
ENDIF
IF OLDROUTINENAMES THEN
;
; The PBxxx() routines are obsolete.
;
; Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
;
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
IF ¨ OLDROUTINELOCATIONS THEN
ENDIF
ENDIF
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
;
;//////////////////////////////////////////////////////////////////////////////
; System 8 Ndrv requests entry point drivers
;
;
; extern OSStatus DoDeviceManagerIO(IOCommandID commandID, IOCommandContents contents, IOCommandCode code, IOCommandKind kind, KernelNotification *someTypeofNotification)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DoDeviceManagerIO
ENDIF
DeviceManagerIOIteratorData RECORD 0
ioCI ds IOCommonInfo ; offset: $0 (0)
pluginNumber ds.w 1 ; offset: $14 (20)
refNum ds.w 1 ; offset: $16 (22)
desc ds DriverDescription ; offset: $18 (24)
sizeof EQU * ; size: $98 (152)
ENDR
;
; extern OSStatus DeviceManagerGetDeviceData(ItemCount requestItemCount, ItemCount *totalItemCount, DeviceManagerIOIteratorData **dataArray)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeviceManagerGetDeviceData
ENDIF
ENDIF
ENDIF ; __DEVICES__